<template>
    <div>
          <!-- 服务内容：<input type="text" v-model="serviceOrder.content"><br><br> -->
          服务备注：<el-input type="text" v-model="serviceOrder.content" style="width:350px"></el-input><br><br>
          <!-- 具体地址：<input type="text" v-model="serviceOrder.appointmentAddress"><br><br>  -->
          具体地址：<el-input type="text" v-model="serviceOrder.appointmentAddress" style="width:350px"></el-input><br><br>
          联系方式：<el-input type="text" v-model="serviceOrder.contactmethod" style="width:250px"></el-input><br><br>
          <!-- &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;          -->
          <!-- 服务时间：<input type="date" v-model="serviceOrder.appointmentTime"><br><br> -->
          <el-date-picker type="datetime" placeholder="选择服务日期" v-model="serviceOrder.appointmentdate" style="width: 140;">
          </el-date-picker><br><br>
          <span>温馨提示，服务实际金额以服务完成后视情况而定，系统价格仅供参考！</span><br><br>

          <el-button type="primary" @click="buy">下单</el-button>

    </div>
</template>
<script>
export default {
  data(){
    return{
        serviceOrder:{
            mid:"",
            username:"",
            cid:"",
            iid:"",
            content:"",
            appointmentAddress:"",
            appointmentTime:"",
            appointmentdate:"",
            contactmethod:"",
            price:"",
            status:""
        },
        date:"",
        date2:""

    }
  },

  methods:{

    buy:function(){
    // alert("实际交易金额以服务完成之后为准，点击继续")
    this.serviceOrder.username=JSON.parse(sessionStorage.getItem("user")).username
     this.serviceOrder.cid=this.$route.query.cid
     this.serviceOrder.iid=this.$route.query.iid
      this.serviceOrder.mid=this.$route.query.mid
      console.log(this.serviceOrder.mid)
    //  this.serviceOrder.status=this.$route.query.status
     this.serviceOrder.status=0
     this.serviceOrder.price=this.$route.query.price
     this.$axios.post("http://localhost:8080/service/order/add",this.serviceOrder).then(res =>{

//  this.$router.push("/serviceorder")
       if(res.data.code=="200"){
        alert("下单成功，点击跳转")
         this.$router.push("/serviceorder")
       }

      })
    }

  }

}
</script>
<style>
</style>
